<div class="layui-form" wid100 lay-filter="LAY-user-form" style="padding: 20px 20px 0 0;">
  <script type="text/html" template>
    <div class="layui-form-item">
      <label class="layui-form-label">登录用户名</label>
      <div class="layui-input-block">
        <input type="hidden" name="id" value="{{ d.params.id || '' }}"/>
        <input type="text" name="username" value="{{ d.params.username || '' }}" lay-verify="required" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">角色</label>
      <div class="layui-input-block">
        <select name="role_id" lay-verify="required" lay-reqtext="请选择角色">
          <option value="">选择角色</option>
          {{# layui.each(d.params.roles, function(index, role){ }}
          <option value="{{ role.key }}" {{ d.params.role_id === role.key ? 'selected':'' }} >{{ role.value }}</option>
          {{# }) }}
        </select>
      </div>
    </div>
    {{# if (!d.params.id) { }}
    <div class="layui-form-item">
      <label class="layui-form-label">登录密码</label>
      <div class="layui-input-inline">
        <input type="password" name="password" value="" lay-verify="required" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">确认密码</label>
      <div class="layui-input-inline">
        <input type="password" name="verify_password" value="" lay-verify="required" class="layui-input"/>
      </div>
    </div>
    {{# } }}
  </script>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="LAY-user-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>

